package cn.sofwin.day0108.homework;

import java.util.Scanner;

/**
 * 判断一个整数是几位数，并按照逆序输出。考察数组
 */
public class ExchangeNumber {
    public static void main(String[] args) {
        // 大数也可
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个数：");
        String number = sc.nextLine();
        System.out.println("这是个" + number.length() + "位数");
        String[] num;
        num = number.split("");
        System.out.print("逆序是：");
        for (int i = number.length() - 1; i >= 0; i--) {
            System.out.print(num[i]);
        }
    }
}
